Add `cargo run` exit_code_verbose test
authorGleb Kozyrev <gleb@gkoz.com>
Tue, 13 Oct 2015 00:30:44 +0000 (03:30 +0300)
committerGleb Kozyrev <gleb@gkoz.com>
Tue, 13 Oct 2015 00:30:44 +0000 (03:30 +0300)
tests/test_cargo_run.rs

index a85e7bc2816857b2c454b4993ec29be188f02a43..3ad49c418542c06fec00f347d6ab638d9139abea 100644 (file)
@@ -105,6 +105,26 @@ test!(exit_code {
                 execs().with_status(2));
 });
 
+test!(exit_code_verbose {
+    let p = project("foo")
+        .file("Cargo.toml", r#"
+            [project]
+            name = "foo"
+            version = "0.0.1"
+            authors = []
+        "#)
+        .file("src/main.rs", r#"
+            fn main() { std::process::exit(2); }
+        "#);
+
+    assert_that(p.cargo_process("run").arg("-v"),
+                execs().with_status(2)
+                       .with_stderr(&format!("\
+Process didn't exit successfully: `target[..]foo` (exit code: 2)
+",
+        )));
+});
+
 test!(no_main_file {
     let p = project("foo")
         .file("Cargo.toml", r#"